package com.qs.education.controller;

import org.apache.log4j.Logger;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationGradeBean;
import com.qs.education.service.IGradeService;

/**
 * 
 * @class GradeController
 * @author Jason
 * @description
 * @date Nov 9, 2018 3:34:05 PM
 */
@Controller
public class GradeController {

	@Autowired
	private IGradeService iGradeService;
	
	private final Logger log = Logger.getLogger(this.getClass());
	/**
	 * @Description 查询所有年级
	 * @author Jason
	 * @date Nov 9, 2018
	 * @return
	 */
	@RequiresPermissions(value={"user:view"})
	@RequestMapping("/getGrade")
	public ModelAndView getGradeList(){
		
		log.info("后台管理-->查询所有年级");
		ModelAndView mv=new ModelAndView("grade/list");
		ResponseListBean<EducationGradeBean> educationGradeList=  iGradeService.getGradeList();
		mv.addObject("educationGradeList", educationGradeList);
		
		return mv;
	}
}
